<template>
  <div class="trend_box">
    <div
      class="trend">
    </div>
  </div>
</template>
<script>
export default {
   data() {
    return {
      chartInstance: null,
      allData: null,// 服务器返回的数据
    //   allData: null,
      timerId: null
    };
  },
  mounted() {
    this.initChart();
    this.getData();
    window.addEventListener('resize',this.screenAdapter);
    this.screenAdapter();
  },
  destroyed(){
    window.removeEventListener('resize',this.screenAdapter);
  },
  methods: {
    initChart() {
      this.chartInstance = this.$echarts.init(this.$refs.trend_ref);
      const initOption = {};
      this.chartInstance.setOption(initOption);
    },
    async getData(){
      this.updateChart();
    },
    updateChart(){
      const dataOption = {};
      this.chartInstance.setOption(dataOption);
    },
    screenAdapter(){
      const adapterOption = {};
      this.chartInstance.setOption(adapterOption);
      this.chartInstance.resize();
    }
  } 
}
</script>
<style scoped>

</style>